<?php $this->load->view(TEMPLATE_NAME . '/front/header'); ?>

<?php $this->load->view(TEMPLATE_NAME . '/front/side_left'); ?>

<style>

.bodyreportabuse{

	/*background-color: #000;*/

	font: normal 15px/100% arial;

	color: #820851;

}

.reportabuse{

	display: block;

	height: 470px;

	width: 430px;

	border: 6px solid #fff;

	background-color: #E2E1D8;

}

.reportabuse a{

	text-decoration: none;

}

.reportabuse a img{

	border: 0px;

}

.reportabuse .close{

	float: right;

	border: 0px;

	margin: 10px;

}

.reportabuse form{

	margin: 20px;

}

.reportabuse h3{

	font: normal 21px arial;

	padding: 0px;

	margin: 5px 0;

}

.reportabuse p{

	padding: 0px;

	margin: 5px 0;

}

.reportabuse label{

	color: #333;

	font-size: 14px;

}

.reportabuse input[type=text],

.reportabuse textarea{

	font: normal 15px arial;

	color: #333;

	border: 1px solid #ccc;

	padding: 5px 4px;

	width: 340px;

	margin: 5px 0;

}

.reportabuse input.spam{

	width: 100px;

	margin: 0 10px;

}

.reportabuse textarea{

	height: 90px;

}

.reportabuse img{

	vertical-align: middle;

}

.reportabuse hr{

	border: 0px;

	height: 1px;

	background-color: #ccc;

}

.reportabuse button{

	background: url(<?php echo base_url() ?>xhtml/img/bgbut.gif) repeat-x top left;

	font-weight: bold;

	border: 1px solid #ABABAB;

	padding: 5px 30px;

	font-size: 12px;

	cursor: pointer;

	margin-left: 100px;

}

.reportabuse button:hover{

	text-shadow: 1px 1px 1px #fff;

}

.erroribnu{

    color: #C00;

}

</style>

<script type="text/javascript" >

function report_abuse_popup(){

		  $.fancybox.showActivity();

			  $.getJSON('<?PHP echo site_url('news/report_abuse/'); ?>/<?php echo $news_content[0]['id'] ?>',function(data){

			      if(data.status != ''){

				$.fancybox(data.content);

				$.fancybox.resize();

				facebook_init();

			      }

			    });

		      return false;

 }





function showpermalink()

{

	document.getElementById('permalinkblock').style.display = "none";

	document.getElementById('rulesblock').style.display = "block";

}

</script>

<style> 

a {color:#333; text-decoration:none}

a:hover {color:#ccc; text-decoration:none}

 

#mask {

  position:absolute;

  left:0;

  top:0;

  z-index:9000;

  background-color:#000;

  display:none;

}

  

#boxes .window {

  position:absolute;

  left:0;

  top:0;

  width:440px;

  height:200px;

  display:none;

  z-index:9999;

  padding:20px;

}

 

#boxes #dialog {

  width:375px; 

  height:203px;

  padding:10px;

  background-color:#ffffff;

}

 

#boxes #dialog1 {

  width:375px; 

  height:203px;

}

 

#dialog1 .d-header {

  background:url(images/login-header.png) no-repeat 0 0 transparent; 

  width:375px; 

  height:150px;

}

 

#dialog1 .d-header input {

  position:relative;

  top:60px;

  left:100px;

  border:3px solid #cccccc;

  height:22px;

  width:200px;

  font-size:15px;

  padding:5px;

  margin-top:4px;

}

 

#dialog1 .d-blank {

  float:left;

  background:url(images/login-blank.png) no-repeat 0 0 transparent; 

  width:267px; 

  height:53px;

}

 

#dialog1 .d-login {

  float:left;

  width:108px; 

  height:53px;

}

 

#boxes #dialog2 {

  background:url(images/notice.png) no-repeat 0 0 transparent; 

  width:326px; 

  height:229px;

  padding:50px 0 20px 25px;

}

</style>



<?php

//$this->load->library('facebook-php-sdk/facebook');

require_once ('facebook.php');

$facebookappid = $this->config->item('facebook_app_id');

$facebookseckey = $this->config->item('facebook_secret_key');

$facebook = new Facebook(array("appId" => $facebookappid, "secret" => $facebookseckey,
    'cookie' => true));

$titletoshow = strtolower($this->News_model->clean_url($news_content[0]['article_heading']));

$testurl = base_url() . "news/news_article/" . $news_content[0]['article_number'] .
    "/" . $titletoshow;

$fqlquery = "SELECT share_count, like_count, click_count FROM link_stat WHERE url='" .
    $testurl . "'";

$param = array('method' => 'fql.query', 'query' => $fqlquery, 'callback' => '');

$likes = $facebook->api($param);

$likecount = $likes[0]['like_count'];
$this->News_model->insert_like_count($news_content['id'], $likecount);




?>

<div class="page">

<h2>Local News <a href="<?php echo site_url('news/news_startup') ?>">Post News</a></h2>



<!--<div class="clear"></div>

<div class="clear"></div>



<div class="clear"></div>

<div>-->

<div class="post">

<!--<strong style="font-size:14px">--><h2 class="title" ><?php echo $news_content[0]['article_heading'] ?></h2> <!--</strong><br>-->

<p class="clear mb0" style="padding-bottom:0"></p>

<?php



if ($news_content[0]['is_anonymous'] != '1') {

    if ($news_content[0]['by_network_post'] != '0') {

        $networkname = $this->News_model->get_network_name($news_content[0]['by_network_post']);

?>

    <!--<span class="purple">--><div class="purple f13">By: <a href="<?php echo
site_url('network/' . $networkname[0]['slug_name']); ?>"><?php echo
$networkname[0]['name'] ?></a></div> <!--</span>-->

    <?php

    } else {

?>

<!--<span class="purple">--><div class="purple f13">By: <a href="<?php echo
site_url('profile'); ?>"><?php echo
$user_info[0]['firstname'] . " " . $user_info[0]['surname'] ?></a></div> <!--</span>-->

<?php

    }

?>

<?php



} else {

?>

    <div class="purple f13">By (Anonymous)</div>

    <?php

}

?>

<!--</div>

<div class="clear"></div>

<div class="purple"><strong>--> 

<div class="meta"><b>Article #<?php echo $news_content[0]['article_number'] ?></b> &nbsp;|&nbsp;

Posted on <?php echo date("Y-m-d") ?> at <?php echo date("H:i") ?> &nbsp;|&nbsp; 

<strong><a href="#"><?php echo $comment_count ?> Comments</a> &nbsp;|&nbsp; <a href=""><?php echo
$news_content[0]['fb_like_count'] ?> likes</a></Strong> &nbsp;|&nbsp; 

Read <?php echo $news_content[0]['view_count'] ?> times &nbsp;|&nbsp; <b><a href="#" onclick="return report_abuse_popup();">Report</a></b></div>



<!--<div class="clear"></div>-->

<!--<div>--><div class="ck_content" style="line-height:160% !important;padding: 3px 0pt ! important;"> <?php echo $news_content[0]['article_description'] ?></div> <!--</div>--> <!--msg container -->

<!--<div class="clear"></div>

<div>--> <!--image container --> <hr />



<?php //Please remove static if its not working

if ($news_photo_info) {

    for ($i = 0; $i <= count($news_photo_info); $i++) {

        if ((!empty($news_photo_info[$i]['news_image'])) && (file_exists("./uploads/news_photo/thumb/" .
            $news_photo_info[$i]['news_image']))) {

            list($width, $height) = getimagesize("./uploads/news_photo/thumb/" . $news_photo_info[$i]['news_image']);

            $width = $width + 26;



?>

	<!--<div style="text-align:center">--><div class="cctv" style='width:<?php echo
$width ?>px; margin:0px auto'>

    <img src="<?php echo base_url(); ?>/uploads/news_photo/thumb/<?php echo $news_photo_info[$i]['news_image'] ?> " alt="<?php echo
$news_content[0]['article_heading'] ?>"  />

    <!--</div>-->

 <!--<div>--><p style="text-align:left"><?php echo $news_photo_info[$i]['image_caption'] ?></p> <!--</div>-->

 <!--<div class="clear"></div>--></div><!-- cctv -->

<?php }

    }

?>

    



<?php

}

?>

<?php

if ($news_content[0]['page_meta_keyword'] != "") {

?>

<div><strong>Tags: <!--<span class="purple">-->&nbsp;<a href="" class="purple"><?php echo
$news_content[0]['page_meta_keyword'] ?> </a></strong> <!--</span>--></div> <!--tags -->

<!--<div class="clear"></div>-->



<?php

}

?>

<hr />

<!--<div>-->

<?php

if ($sourcecontent) {

    for ($i = 0; $i < count($sourcecontent); $i++) {

?>

    <!--<div>--><strong>Source: <!--<span class="purple">--><?php echo $sourcecontent[$i]['source_name'] ?><?php if ($sourcecontent[$i]['source_link'] !=
"") { ?> ( <a href="<?php echo
$sourcecontent[$i]['source_link'] ?>" target="_blank" class="purple">View Link </a> )<?php } ?></strong> <!--</span></div>-->

    <!--<div class="clear"></div> --><hr />

    <?php

    }

}

?>

<!--</div>-->	<!--source lists -->

<!--<div class="clear"></div>-->

<!--<div style="float:left; width:400px">-->

<div class="fb_like">

<div id="fb-root" style="text-align:center;">
<fb:like show_faces="false"></fb:like>

<!-- facebook like-->

</div>

</div><!-- box3 -->

<!--<div style="float:left">-->

<div class="socialnet_share">

        <!-- AddThis Button BEGIN -->

       <div class="share_right"> <div class="addthis_toolbox addthis_default_style">

        <a href="http://www.addthis.com/bookmark.php?v=250&amp;username=turnitaround" class="addthis_button_compact">Share</a>

        <span class="addthis_separator">|</span>

        <a class="addthis_button_facebook"></a>

        <a class="addthis_button_myspace"></a>

        <a class="addthis_button_google"></a>

        <a class="addthis_button_twitter"></a>

        </div></div>

        

        <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=turnitaround"></script>

        <!-- AddThis Button END -->

    </div><!-- box3 -->

<div class="clear"></div>

</div><!-- post -->

<div id="permalinkblock" style="display:block; padding-top:9px">

Want to reproduce this news item in print or online? <a href="javascript:;" onclick="showpermalink()" class="purple">Click here for details</a>

</div>

<hr />

<div  style="display:block; padding-top:0px"><strong>Disclaimer:</strong> All articles and letters published on Turn It Around (www.turnitaround.co.za) have been independently written by members of Turn it Around's community. The views of users published on Turn It Around are therefore their own and do not necessarily represent the views of Turn It Around. 

Turn It Around's editors also reserve the right to edit or delete any and all comments received.</div>

<div id="rulesblock" class="fb_like" style="width:577px; height:auto; margin-top:9px; padding:6px 6px 6px 6px; display:none">

<div><strong>Want to reproduce this news item in print or in online</strong></div>

<div style="margin-top:5px">You may reproduce this article online or in a printed form on condition that -<br />

<strong>1.</strong> You give credit to the author (unless author is anonymous) and <Br />

<strong>2.</strong> You give refence to www.turnitaround.co.za and the article number (#<?php echo
$news_content[0]['article_number'] ?>). <br />

<strong>3.</strong> You link to the original article (if online) to the permalink displayed below.</div>

<div style="margin-top:8px" class="purple">

<Strong>Permalink:</Strong> <br />

<?php

$titletoshow = $this->News_model->clean_url($news_content[0]['article_heading']);

echo base_url() . "news/news_article/" . $news_content[0]['article_number'] .
    "/" . $titletoshow ?>

</div>

</div>

<div class="clear"></div>

<hr />



<script type="text/javascript">

var comment_for_url = "<?php echo $this->config->item("base_url") .
"news/news_article/" . $news_content[0]['article_number'] . "/" . $titletoshow;

?>";

var pathname_exploded = window.location.pathname.split("/").reverse();

  var article_number = pathname_exploded['1'];

</script>

<link rel="stylesheet" href="<?php echo $this->config->item("base_url") ?>comment-sys/api/comment.css" type="text/css"/>

<script src="http://connect.facebook.net/en_US/all.js" type="text/javascript"></script>

<script type="text/javascript" src="<?php echo $this->config->item("base_url") ?>comment-sys/api/apicall.js"></script>

<div id="commenting-system">

</div>



<?php /*?>

<div id="commenting-system">

<div id="fb-root">

<script>

window.fbAsyncInit = function() {

FB.init({appId: '121149471277296', status: true, cookie: true,

xfbml: true});

};

(function() {

var e = document.createElement('script'); e.async = true;

e.src = document.location.protocol +

'//connect.facebook.net/en_US/all.js';

document.getElementById('fb-root').appendChild(e);

}());

</script>

<fb:comments width="599"></fb:comments>

</div>

</div>

<?php */ ?>

<!--	<div class="clear"></div>

</div>-->	  <!--comment listing-->

<!--<div class="clear"></div>-->

<hr />

    <?php $this->load->view(TEMPLATE_NAME . '/front/footer_menu'); ?>

</div><!-- page -->

<div id="boxes"> 

<div id="dialog" class="window"> 

<div style="float:left; width:100px;"><span class="purple">Report Abuse</span></div><div style="float:right; text-align:right"><a href="#"class="close"/>Close it</a></div> 

<div class="clear"></div>

<div class="purple">Unhappy with this news story, photo or comment on this website? Then tell us about it here</div>

<div class="clear"></div>

<div id="formbox">

	<div>Your Name: *</div>

    <div><input type="text" name="yourname" id="yourname" /></div>

    <div>Your E-mail: *</div>

    <div><input type="text" name="youremail" id="youremail" /></div>

    <div>Your Comment: *</div>

    <div><textarea name="commenttxt" id="commenttxt"></textarea><input type="hidden" name="articleid" id="articleid" value="<?php echo
$news_content[0]['id'] ?>" /></div>

    <div><input type="button" value="Submit" onclick="sendabuse();" /> </div>

</div>

<div class="clear"></div>



</div> 

<!-- Mask to cover the whole screen --> 

  <div id="mask"></div> 

</div> 

<?php $this->load->view(TEMPLATE_NAME . '/front/side_right'); ?> 

    

<?php $this->load->view(TEMPLATE_NAME . '/front/footer'); ?> 

